<template>

    <div class="m-style have-nav">
                <blockIndexNavBar title="延付台账"></blockIndexNavBar>
        <!--        <van-row>-->
        <!--            <van-col span="16">-->
        <!--                <van-search-->
        <!--                    placeholder="请输入姓名"-->
        <!--                    v-model="searchCondition"-->
        <!--                    @search="onSearch"-->
        <!--                >-->
        <!--                </van-search>-->
        <!--            </van-col>-->
        <!--            <van-col span="8" class="search-btn">-->
        <!--                <van-button type="primary" size="small" @click="onSearch">搜索</van-button>-->
        <!--            </van-col>-->
        <!--        </van-row>-->

        <!--        <van-pull-refresh v-model="refreshing" @refresh="onRefresh">-->
        <!--            <van-list-->
        <!--                v-model="loading"-->
        <!--                :finished="finished"-->
        <!--                finished-text="没有更多了"-->
        <!--                @load="getData"-->
        <!--            >-->
        <!--                <lee-card v-for="item in dataList" :key="item._id">-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">姓名</van-col>-->
        <!--                        <van-col span="12">{{ item.userName }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">身份证号码</van-col>-->
        <!--                        <van-col span="12">{{ item.idCard }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">延付金额</van-col>-->
        <!--                        <van-col span="12">{{ item.deferredAmount }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">延付余额</van-col>-->
        <!--                        <van-col span="12">{{ item.deferredBalance }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">兑付金额</van-col>-->
        <!--                        <van-col span="12">{{ item.redemptionAmount }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">赔偿金额</van-col>-->
        <!--                        <van-col span="12">{{ item.compensationAmount }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">实兑付金额</van-col>-->
        <!--                        <van-col span="12">{{ item.realPayment }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">赔偿余额</van-col>-->
        <!--                        <van-col span="12">{{ item.compensationBalance }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">已赔金额</van-col>-->
        <!--                        <van-col span="12">{{ item.lostAmount }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">个人损失金额</van-col>-->
        <!--                        <van-col span="12">{{ item.personalLoss }}</van-col>-->
        <!--                    </van-row>-->
        <!--                    <van-row>-->
        <!--                        <van-col span="12">状态</van-col>-->
        <!--                        <van-col span="12">{{ item.status }}</van-col>-->
        <!--                    </van-row>-->
        <!--                </lee-card>-->
        <!--            </van-list>-->
        <!--        </van-pull-refresh>-->
        <m_pageList
            ref="pageList"
            :url="url"
            :cols="cols"
            :list-cond="listCond"
            @toDetail="toDetail"
        >
            <template v-slot="scope">
                <strong>{{ scope.row.status }}</strong>
            </template>
        </m_pageList>
    </div>
</template>

<script>
import {Config} from "@/config/formDataOptions";
import blockIndexNavBar from "@/components/blockIndexNavBar";
import LeeCard from "@/uitl/card";
import {API_URL} from "@/config/urlInfo";
import m_pageList from "@/uitl/m_pageList";


export default {
    name: "yanfutaizhang",
    components: {
        LeeCard,
        blockIndexNavBar,
        m_pageList
    },
    data() {
        return {
            url: API_URL.deferredAccountList,
            cols: {
                show: [
                    {title: '延付金额', field: 'deferredAmount'},
                    {title: '延付余额', field: 'deferredBalance'},
                    {title: '兑付金额', field: 'redemptionAmount'},
                    {title: '赔偿金额', field: 'compensationAmount'},
                    {title: '实兑付金额', field: 'realPayment'},
                    {title: '赔偿余额', field: 'compensationBalance'},
                    {title: '已赔金额', field: 'lostAmount'},
                    {title: '个人损失金额', field: 'personalLoss'},
                    {title: '状态', field: 'status'},
                ],
                // hide: [
                //     {title: '位置', field: 'address'}
                // ]
            },
            listCond: {},
            minDate: new Date(1990, 0, 1),
            searchCondition: "",
            list: [],
            loading: false,
            finished: false,
            refreshing: false,
            dataList: [],
            date: '',
            show: false,
            currentPage: 1,
        };
    },
    mounted() {
        this.getData()
    },
    methods: {
        toDetail() {

        },
        onSearch() {
            this.getData()
        },
        onRefresh() {
            // 清空列表数据
            this.finished = false;

            // 重新加载数据
            // 将 loading 设置为 true，表示处于加载状态
            this.loading = true;
            this.dataList = [];
            this.currentPage = 1;
            this.getData();
        },

        getData() {
            // Config.getDatas("/mobile/api/MobileLatePayment/deferredAccountList", {
            Config.getDatas(API_URL.deferredAccountList, {
                data: {
                    size: 15,
                    page: this.currentPage,
                    searchCondition: this.searchCondition
                }
            }, (res) => {
                let list = res.list
                this.loading = false;
                this.refreshing = false;
                if (!list || list.length < 15) {
                    this.finished = true;
                } else {
                    this.currentPage++;
                    this.finished = false;
                }
                this.dataList.push(...list)
            }, this)
        }
    }
}
</script>

<style scoped lang="less">
.search-btn {
    .van-button {
        width: 48%;
        margin-right: 1%;
    }

    background: #fff;
    text-align: center;
    padding: 11px 0;
}

.list-btn {
    .van-button {
        width: 45%;
        margin-right: 2%;
        float: right;
    }
}

.wt-card {
    margin: 0.4rem;
    background: #fff;
    overflow: hidden;
    border-radius: 0.3rem;
    padding: 0.4rem;
    box-shadow: 0 0 0.2rem #ccc;
    border-bottom: 0.1rem solid #ccc;
}


.icons-warp {
    border-radius: 25px;

    .float-icon-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 50px;
        height: 50px;

        img {
            width: 25px;
            height: 25px;
            margin-bottom: 3px;
        }

        span {
            font-size: 9px;
            color: #666666;
        }
    }
}

</style>
